| Conditions | 1 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { MigrationInterface, QueryRunner } from 'typeorm'; |
||
| 6 | |||
| 7 | public async up(queryRunner: QueryRunner): Promise<void> { |
||
| 8 | await queryRunner.query( |
||
| 9 | `CREATE TYPE "public"."notification_type_enum" AS ENUM('post', 'comment', 'reaction')` |
||
| 10 | ); |
||
| 11 | await queryRunner.query( |
||
| 12 | `CREATE TABLE "notification" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."notification_type_enum" NOT NULL, "resourceId" character varying NOT NULL, "message" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "leaveRequestId" uuid, CONSTRAINT "PK_705b6c7cdf9b2c2ff7ac7872cb7" PRIMARY KEY ("id"))` |
||
| 13 | ); |
||
| 14 | await queryRunner.query( |
||
| 15 | `ALTER TABLE "notification" ADD CONSTRAINT "FK_d7dcd7fa90cc4542719b880bc7f" FOREIGN KEY ("leaveRequestId") REFERENCES "leave_request"("id") ON DELETE SET NULL ON UPDATE NO ACTION` |
||
| 16 | ); |
||
| 27 |